import { createApp } from 'vue'
import App from './App.vue'
import router from './router'
import store from './store'
import lazyPlugin from 'vue3-lazy'

import EmptyDirective from '@/components/Base/Empty/directive'
import LoadingDirective from '@/components/Base/Loading/directive'
import { registerGlobalCom } from '@/components/Base/registerGlobalCom'

// 引入全局样式文件
// import '@/assets/fonts/iconfont'
import '@/assets/fonts/iconfont.css'
import '@/assets/scss/index.scss'

// const DEFAULT_IMAGE = require('https://iyunlang.top/assets/images/avatar4.png')

const app = createApp(App).use(store).use(router)
app.directive('loading', LoadingDirective)
app.directive('empty', EmptyDirective)
app.use(lazyPlugin, {
  loading: require('@/assets/images/avatar4.png'),
  error: require('@/assets/images/avatar4.png')
})

registerGlobalCom(app)

app.mount('#app')
